﻿//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Web;
//using System.Web.UI;
//using System.Web.UI.WebControls;

//using Ivy.UserRegistration.Entity;


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using System.Configuration;

using Ivy.Common.Framework.GeneralUtility;
using Ivy.UserRegistration.IBusinessLogic;
//using Ivy.UserRegistration.BusinessLogic;
using Ivy.UserRegistration.Entity;
using Ivy.UserRegistration.DataAccess;

using Hsmp.SocietyAdmin.Entity;
using Hsmp.SocietyAdmin.IBusinessLogic;
using Hsmp.SocietyAdmin.DataAccess;

using Hsmp.SocietyOperation.IBusinessLogic;
using Hsmp.SocietyOperation.Entity;
using Hsmp.SocietyOperation.DataAccess;
using Hsmp.SocietyOperation.BusinessLogic;
using HSMPWeb.ViewEntity;


namespace HSMPWeb.Pages
{
    public partial class TestPageForSagar : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            SocietyManagementMemberRegisterDao_GetSelectedUserProfile(4);
            //SocietyManagementMemberRegisterDao_InsertCommitteeMember();
            //SocietyManagementMemberRegisterDao_UpdateCommitteeMember();
            //SocietyManagementMemberRegisterDao_GetSelectedUser(2);
            //SocietyManagementMemberRegisterDao_GetSelectedSociety(4);
            //SocietyManagementMemberRegisterDao_GetManagementMemberBySocietyKeyAndUserKey(2, 5);
            //SocietyManagementMemberRegisterDao_GetAllSocietyManagementCommitteeMember(2);
            //UserRoleDao_Insert();
            //UserRoleDao_Update();
            //UserRoleDao_GetByUserKeySocietyKeyRoleKey(3,8,3);
            //UserRoleDao_GetByUserKey(2);
            //UserRoleDao_GetByUserKeyRoleKey(2, 5);
            //UserRoleDao_GetByUserKeySocietyKey(2, 1);

        }

        //private void UserRoleDao_Insert()
        //{
        //    UserRole lUserRole = new UserRole();
        //    //UserRoleDao lUserRoleDao = new UserRoleDao();

        //    lUserRole.UserKey = 3;
        //    lUserRole.UserSocietyKey = 10;
        //    lUserRole.UserRoleKey = 4;
        //    lUserRole.UserLoginID = "Sagar";
        //    lUserRole.UserRoleCode = "SCTSUPADM";

        //    lUserRole.Sys_CreatedByID = "sagar";

        //    UserRegistrationBus lUserRegistrationBus = new UserRegistrationBus();
        //    lUserRegistrationBus.AddRoleToUser(lUserRole);


        //    //lUserRoleDao.Insert(lUserRole);

        //}

        //private void UserRoleDao_Update()
        //{
        //    UserRole lUserRole;
        //    UserRoleDao lUserRoleDao = new UserRoleDao();

        //    lUserRole = lUserRoleDao.GetByUserKeySocietyKeyRoleKey(3, 8, 3);

        //    //lUserRole.UserKey = 3;
        //    //lUserRole.UserSocietyKey = 8;
        //    //lUserRole.UserRoleKey = 3;

        //    lUserRole.UserLoginID = "Sagar Kumar";
        //    lUserRole.UserRoleCode = "FLTOWNER1";

        //    lUserRole.Sys_CreatedByID = "Pravesh";


        //   //lUserRoleDao.Update(lUserRole);
        //    UserRegistrationBus lUserRegistrationBus = new UserRegistrationBus();
        //    lUserRegistrationBus.UpdateRegisterdUserRole(lUserRole);
        //}

        //private void UserRoleDao_GetByUserKeySocietyKeyRoleKey(int UserKey, int SocietyKey, int RoleKey)
        //{
            
        //    //UserRoleDao lUserRoleDao = new UserRoleDao();

        //   // UserRole lUserRole = lUserRoleDao.GetByUserKeySocietyKeyRoleKey(2, 1, 1);
            
        //    UserRole lUserRole;
            
        //    UserRegistrationBus lUserRegistrationBus = new UserRegistrationBus();
        //    lUserRole = lUserRegistrationBus.GetSelectedUserRoleByUserKeySocietyKeyRoleKey(UserKey, SocietyKey, RoleKey);
            
            
        //}
        

        //private List<UserRole> UserRoleDao_GetByUserKey(int Userkey)
        //{
        //    //UserRoleDao lUserRoleDao = new UserRoleDao();

        //    //List<UserRole> lUserRole = lUserRoleDao.GetByUserKey(2);

        //    List<UserRole> lUserRole;
        //    UserRegistrationBus lUserRegistrationBus = new UserRegistrationBus();
        //    lUserRole = lUserRegistrationBus.GetSelectedUserRoleByUserKey(Userkey);
        //    return lUserRole;
       // }

        //private List<UserRole> UserRoleDao_GetByUserKeyRoleKey(int UserKey, int RoleKey)
        //{
        //    //UserRoleDao lUserRoleDao = new UserRoleDao();

        //    //List<UserRole> lUserRole = lUserRoleDao.GetByUserKeyRoleKey(3, 3);

        //    List<UserRole> lUserRole;
        //    UserRoleDao lUserRoleDao = new UserRoleDao();
        //    UserRegistrationBus lUserRegistrationBus = new UserRegistrationBus();
        //    lUserRole = lUserRegistrationBus.GetSelectedUserRoleByUserKeyRoleKey(UserKey, RoleKey);
        //    return lUserRole;

        //}

        //private List<UserRole> UserRoleDao_GetByUserKeySocietyKey(int UserKey, int SocietyKey)
        //{
        //    //UserRoleDao lUserRoleDao = new UserRoleDao();

        //    //List<UserRole> lUserRole = lUserRoleDao.GetByUserKeySocietyKey(2, 1);

        //    List<UserRole> lUserRole;
        //    UserRegistrationBus lUserRegistrationBus = new UserRegistrationBus();
        //    lUserRole = lUserRegistrationBus.GetSelectedUserRoleByUserKeySocietyKey(UserKey, SocietyKey);
        //    return lUserRole;

        //}

        private void SocietyManagementMemberRegisterDao_GetManagementMemberBySocietyKeyAndUserKey(int SocietyKey, int UserKey)
        {
            SocietyManagementMemberRegisterDao lSocietyManagementMemberRegisterDao = new SocietyManagementMemberRegisterDao();
            SocietyManagementMemberRegister lSocietyManagementMemberRegister = lSocietyManagementMemberRegisterDao.GetManagementMemberBySocietyKeyAndUserKey(SocietyKey, UserKey);

        }
        
        private void SocietyManagementMemberRegisterDao_GetSelectedSociety(int SocietyKey)
        {
            SocietyManagementMemberRegisterDao lSocietyManagementMemberRegisterDao = new SocietyManagementMemberRegisterDao();
            //SocietyManagementMemberRegister lSocietyManagementMemberRegister = lSocietyManagementMemberRegisterDao.GetSelectedSociety(SocietyKey);

            SocietyManagementCommitteeRegistrationBus lSocietyManagementCommitteeRegistrationBus = new SocietyManagementCommitteeRegistrationBus();
            Society lSociety = lSocietyManagementCommitteeRegistrationBus.GetSelectedSociety(SocietyKey);

        }

        private void SocietyManagementMemberRegisterDao_GetSelectedUser(int UserKey)
        {
            //SocietyManagementMemberRegisterDao lSocietyManagementMemberRegisterDao = new SocietyManagementMemberRegisterDao();
            
            SocietyManagementCommitteeRegistrationBus lSocietyManagementCommitteeRegistrationBus = new SocietyManagementCommitteeRegistrationBus();
            User lUser = lSocietyManagementCommitteeRegistrationBus.GetSelectedUser(UserKey);
        }

        private List<SocietyManagementMemberRegister> SocietyManagementMemberRegisterDao_GetAllSocietyManagementCommitteeMember(int SocietyKey)
        {
            SocietyManagementMemberRegisterDao lSocietyManagementMemberRegisterDao = new SocietyManagementMemberRegisterDao();
            List<SocietyManagementMemberRegister> lSocietyManagementMemberRegister = lSocietyManagementMemberRegisterDao.GetManagementMembersBySocietyKey(SocietyKey);
            return lSocietyManagementMemberRegister;

        }

        private void SocietyManagementMemberRegisterDao_GetSelectedUserProfile(int UserKey)
        {
            SocietyManagementCommitteeRegistrationBus lSocietyManagementCommitteeRegistrationBus = new SocietyManagementCommitteeRegistrationBus();
            UserProfile lUserProfile = lSocietyManagementCommitteeRegistrationBus.GetSelectedUserProfile(UserKey);
        }
        
        private void SocietyManagementMemberRegisterDao_InsertCommitteeMember()
        {
            SocietyManagementMemberRegister lSocietyManagementMemberRegister = new SocietyManagementMemberRegister();
            //SocietyManagementMemberRegisterDao lSocietyManagementMemberRegisterDao = new SocietyManagementMemberRegisterDao();
            
            lSocietyManagementMemberRegister.MemberUserKey = 9;
            lSocietyManagementMemberRegister.MemberSocietyKey = 11;
            lSocietyManagementMemberRegister.UserLoginID = "vikas";
            lSocietyManagementMemberRegister.SocietyName = "46";
            lSocietyManagementMemberRegister.StartDateOfMembership = Convert.ToDateTime("2014/12/22");
            lSocietyManagementMemberRegister.EndDateOfMembership = Convert.ToDateTime("2014/11/22");
            

            lSocietyManagementMemberRegister.Sys_CreatedByID = "Pravesh";

            //lSocietyManagementMemberRegisterDao.Insert(lSocietyManagementMemberRegister);
            SocietyManagementCommitteeRegistrationBus lSocietyManagementCommitteeRegistrationBus = new SocietyManagementCommitteeRegistrationBus();
            lSocietyManagementCommitteeRegistrationBus.AddSocietyManagementCommitteeMember(lSocietyManagementMemberRegister);

        }

        private void SocietyManagementMemberRegisterDao_UpdateCommitteeMember()
        {
            SocietyManagementMemberRegister lSocietyManagementMemberRegister;
            SocietyManagementMemberRegisterDao lSocietyManagementMemberRegisterDao = new SocietyManagementMemberRegisterDao();


            lSocietyManagementMemberRegister = lSocietyManagementMemberRegisterDao.GetManagementMemberBySocietyKeyAndUserKey(11, 9);
            lSocietyManagementMemberRegister.UserLoginID = "Vikas";
            lSocietyManagementMemberRegister.SocietyName = "Shobha";
            
            lSocietyManagementMemberRegister.StartDateOfMembership = Convert.ToDateTime("2014/11/12");
            lSocietyManagementMemberRegister.EndDateOfMembership = Convert.ToDateTime("2015/11/12");
            
            //lSocietyManagementMemberRegisterDao.Update(lSocietyManagementMemberRegister);
            SocietyManagementCommitteeRegistrationBus lSocietyManagementCommitteeRegistrationBus = new SocietyManagementCommitteeRegistrationBus();
            lSocietyManagementCommitteeRegistrationBus.UpdateRegisteredSocietyManagementCommitteeMember(lSocietyManagementMemberRegister);
           
        }

    }
}